package cn.beausoft.mybatis3.test.mapper.auto;

import org.apache.ibatis.annotations.Mapper;
import cn.beausoft.mybatis3.sqlbuild.condition.original.PreparedCondition;
import cn.beausoft.mybatis3.sqlbuild.selector.SelectMetadata;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import cn.beausoft.mybatis3.test.entity.FileResource;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 文件资源表
 * @author hjp
 */
@Mapper
public interface FileResourceAutoMapper {
    //region read
    List<FileResource> selectAll();
    List<FileResource> select(@Param("meta") SelectMetadata metadata);
    PageList<FileResource> selectPage(@Param("meta") SelectMetadata metadata, PageBounds pageBounds);
    FileResource selectRow(@Param("meta") SelectMetadata metadata);

    Map selectForMap(@Param("meta") SelectMetadata metadata);
    List<Map> selectForListMap(@Param("meta") SelectMetadata metadata);
    PageList<Map> selectPageForListMap(@Param("meta") SelectMetadata metadata, PageBounds pageBounds);
    //endregion

    //region write
    int insert(FileResource record);
    int insertSelective(FileResource record);

    int update(@Param("record") FileResource record,@Param("wheres") List<PreparedCondition> conditions);
    int updateSelective(@Param("record") FileResource record,@Param("wheres") List<PreparedCondition> conditions);

    int delete(@Param("wheres") List<PreparedCondition> conditions);
    //endregion
}